var SHOPCART = function(){
	var o ={};
	o.run = function(){
		o.shopcart();
	}
	o.shopcart = function(){
		$.get('/Api/Shop/shopcart',{shop_id:shop_id},function(ret){
		if(ret.staus == true){			
			//template.helper('type_id',type_id);
			var prices =0;	
			var html = template('shopcart-tpl',ret);
			$('#shopcart').prepend(html);
			var len =$('input[name="items[]"]:checked').length;
				$('input[name="items[]"]:checked').each(function(){
					var price=$(this).parents(".delfather").find(".J_ItemSum").text();
					//alert(price);
					prices=prices+parseFloat(price);
				});	
				$("#J_SelectedItemsCount").text(len);
				$("#J_Total").text(prices);
		}else{
			//alert("购物车为空！");
		}
	});	
	}
	o.Lunbo = function (){
		$.get('/Api/Article/Lunbo',{type_id:type_id},function(ret){
			if(ret.staus == true){
				var html = template('article-alist-lunbo',ret);
				$('#lunbo').append(html);
				$('#demo-slider-0').flexslider();
			}else{
				alert("无法轮播！");
			}
		});
	}
	return o;
}();

